<%-- 
    Document   : colores
    Created on : 27/08/2014, 07:10:14 PM
    Author     : tms
--%>

<%@page import="java.util.Map"%>
<%@page import="java.util.HashMap"%>
<%@page import="net.sf.jasperreports.engine.JasperRunManager"%>
<%@page import="net.sf.jasperreports.engine.JasperCompileManager"%>
<%@page import="net.sf.jasperreports.engine.JasperReport"%>
<%@page import="org.apache.jasper.el.JasperELResolver"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
      <jsp:useBean id="conn" class="operaciones.procedimientoempresa" scope="page"></jsp:useBean>

     
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <h1>Hello World!</h1>
        <%                       
            //int num_solicitud=Integer.parseInt(request.getParameter("num_solicitud"));
        try{
            if(conn.conectar()){
              JasperReport r=JasperCompileManager.compileReport("C://Users//Regalo_Caro//Documents//NetBeansProjects//trunk//utm//web//reportes//vsinatender.jrxml");  
               byte[] bytes= JasperRunManager.runReportToPdf(r,null,conn.conexion);
              response.setContentType("application/pdf");
              response.setContentLength(bytes.length);
              ServletOutputStream outputStream=response.getOutputStream();
              outputStream.write(bytes, 0,bytes.length);
              outputStream.flush();
              outputStream.close();
            }
        }
        
          catch (Exception e)
          {
          
              out.print(""+e);
          }
        %>
    </body>
</html>
